package com.pluginapp;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.widget.Toast;

import info.axbase.appprot.ComponentRegister;
import info.axbase.appprot.Protocol;

/**
 * Auth：yujunyao
 * Since: 2016/6/1 15:33
 * Email：yujunyao@yonglibao.com
 */
public class PluginActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_plugin);

        Protocol host = ComponentRegister.getInstance().getComponent("host");
        if(host != null) {
            Toast.makeText(this, (String) host.call(""), Toast.LENGTH_LONG).show();
        }

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        Toast.makeText(this, "Plugin 返回键监听", Toast.LENGTH_LONG).show();
        return super.onKeyDown(keyCode, event);
    }
}
